//
//  HuUITools.h
//  need
//
//  Created by AcHu on 15/11/5.
//  Copyright (c) 2015年 oc. All rights reserved.
//

#import <UIKit/UIKit.h>


@interface HuUITools : UIView

+ (CGSize)getTextWidth:(NSString *)text font:(UIFont *)font;    //获取label的宽度
+ (CGSize)getTextHeight:(NSString *)text font:(UIFont *)font width:(CGFloat)width;  //获取高
+ (UIImage *)buttonImageFromColor:(UIColor *)color frame:(CGRect)frame;  //颜色转图片
+ (NSString *)dataJsonWithDic:(id)paramObj;   //将字典转为json
+ (id)dicWithJsonString:(NSString *)jsonString;  //json转数组、字典对象

//创建VIew
+(UIView *)viewRect:(CGRect)rect color:(UIColor *)color radius:(float)radius fatherView:(UIView *)view;

//创建imageView
+(UIImageView *)imageView:(CGRect)rect image:(UIImage *)image radius:(float)radius fatherView:(UIView *)view;

//创建TextField
+(UITextField *)textField:(CGRect)rect borderStyle:(UITextBorderStyle)style font:(UIFont *)font textColor:(UIColor *)color place:(NSString *)str keyBordType:(UIKeyboardType)type secure:(BOOL)entry clearButMode:(BOOL)isOrNo clearBegin:(BOOL)foo delegate:(id<UITextFieldDelegate>)se fatherView:(UIView *)view;

//创建textView
+(UITextView *)textView:(CGRect)rect font:(UIFont *)font textColor:(UIColor *)color delegate:(id<UITextViewDelegate>)se fatherView:(UIView *)view;

//创建button基于图片
+(UIButton *)butWithImage:(CGRect)rect image:(UIImage *)image bgImage:(UIImage *)bgImage highlightedImage:(UIImage *)hImage radius:(float)radius addTarg:(id)se action:(SEL)sel fatherView:(UIView *)view;

//创建button基于文字
+(UIButton *)butWithTitle:(CGRect)rect title:(NSString *)title font:(UIFont *)font titleColor:(UIColor *)co bgColor:(UIColor *)bgCol radius:(float)radius addTarg:(id)se action:(SEL)sel fatherView:(UIView *)view;

//创建label
+(UILabel *)label:(CGRect)rect bgColor:(UIColor *)bgCol text:(NSString *)text font:(UIFont *)font textColor:(UIColor *)textcol textAlignment:(NSTextAlignment)ali fatherView:(UIView *)view;

//创建scroll
+(UIScrollView *)scrollView:(CGRect)rect bgColor:(UIColor *)col size:(CGSize)size offset:(CGPoint)point cancelXProgress:(BOOL)isOrNo delegate:(id<UIScrollViewDelegate>)se fatherView:(UIView *)view;


@end
